<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>继承的简单使用</title>
	</head>
	<body>
		<script type="text/javascript">
			class Father{
				constructor(x,y){
					this.x = x;
					this.y = y;
				}
				add(){
					console.log(parseFloat(this.x+this.y));
				}
			}
			class Son extends Father{
				constructor(x,y){
					super(x,y);
					this.x = x;
					this.y = y;
				}
			}
			var f = new Father(3,9);
			f.add();
			var s = new Son(5,7);
			s.add();
		</script>
	</body>
</html>